#ifndef _LED_H
#define _LED_H

#include "MIMXRT1052.h"
#define HF_LED_ON							0
#define HF_LED_OFF						1

#define GPIO_Toggle(gpio_port,gpio_pin) (gpio_port->DR ^= (1<<gpio_pin)) 	//LED0输出电平翻转

//LCD背光灯控制
#define HF_LCD_BRIGHT_OPEN()				GPIO_PinWrite(GPIO2,20,1) 
#define HF_LCD_BRIGHT_OPEN1()				GPIO_PinWrite(GPIO2,21,1)		

#define HF_LCD_BRIGHT_CLOSE()				GPIO_PinWrite(GPIO2,20,0) 
#define HF_LCD_BRIGHT_CLOSE1()			GPIO_PinWrite(GPIO2,21,0)


//电源指示灯
#define HF_POWER_LED(st)						(st?GPIO_PinWrite(GPIO1,3,1):GPIO_PinWrite(GPIO1,3,0))
#define HF_POWER_Toggle 						(GPIO1->DR ^= (1<<3)) 	//输出电平翻转

//交流电指示灯
#define HF_AC_LED(st)								(st)//(st?GPIO_PinWrite(GPIO3,3,1):GPIO_PinWrite(GPIO3,3,0))
#define HF_AC_Toggle 								()//(GPIO3->DR ^= (1<<3)) 	//输出电平翻转

//电池指示灯
#define HF_BATTERY_LED(st)					(st?GPIO_PinWrite(GPIO5,2,1):GPIO_PinWrite(GPIO5,2,0))
#define HF_BATTERY_TOGGLE()					()

//报警指示灯   红绿蓝
#define HF_WARN_RED_LED(st)					(st)		
#define HF_WARN_GREEN_LED(st)				(st)
#define HF_WARN_BLUE_LED(st)				(st)

#define HF_WARN_RED_TOGGLE()				()
#define HF_WARN_GREEN_TOGGLE()			()
#define HF_WARN_BLUE_TOGGLE()				()

void task_led_init(void);
void LCD_BledEnInit(void);
void LED_Init(void);
//电池供电LED初始化
void HF_LedBatInit(void);

#endif
